Flashcopy handling

ABSTRACT

A technique for handling a FlashCopy® process includes receiving a FlashCopy® instruction for a source disk, performing a FlashCopy® point in time copy of the source disk on to a target disk, creating a map specifying the FlashCopy® point in time copy from the source disk to the target disk, creating a primary fdisk for the source disk, if one does not already exist, and creating a primary fdisk for the target disk, if one does not already exist, or, if one does already exist, converting the existing primary fdisk for the target disk into a secondary fdisk, and creating a new primary fdisk for the target disk.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No. 13/125,276, filed Apr. 20, 2011, which is the National Stage of International Application No. PCT/EP2009/063755, filed Oct. 20, 2009, which claims priority from European Patent Application No. EP 08167951.6, filed Oct. 30. 2008, wherein the related U.S., PCT, and Japanese Patent applications are all incorporated herein by reference in their entirety.

BACKGROUND

This invention relates to a method of and system for, handling a FlashCopy® process. (FlashCopy is a registered trademark of International Business Machines Corporation in the United States and other countries.) In one embodiment the method can be used for reversing a FlashCopy® mapping in a cascade.

A FlashCopy® process is a feature supported on various storage devices that allows a user or an automated process to make nearly instantaneous copies of entire logical volumes of data. A copy of a source disk is made on a target disk. The copies are immediately available for both read and write access. A common feature of FlashCopy® process like implementations is the ability to reverse the copy. That is, to populate the source disk of a FlashCopy® map with the contents of the target disk. With cascaded implementations, in which a target disk later becomes the source disk for a further FlashCopy® process, this feature is complicated by the fact that the “grains” of data presented by a disk are located on a number of target/source disks “upstream” of the disk itself. This means that in order for a disk to maintain the image it is presenting, it must have access to all the disks containing these grains of data.

Reversing a FlashCopy® process is the process of ensuring that the source disk presents the same image as the target disk, at the point in time that the reverse is started. This means that the contents of the source disk need to be modified in order to maintain the correct image. Now, if all of the target disks between the source and target disks in the cascade and the target disk itself are not needed, then the reverse can be achieved by simply taking offline all the target disks and reversing the order of the source and target disks in the cascade. Although this solution is sufficient for some use cases, it drastically restricts the flexibility of the FlashCopy® implementation, because in most cases the user will be reluctant to accept the loss of their intermediate FlashCopy® images, since they may contain other valid backup copies of the original source.

It is therefore an object of the invention to improve upon the known art.

SUMMARY

According to a first aspect of the present invention, there is provided a method of handling a FlashCopy® process comprising receiving a FlashCopy® instruction for a source disk, performing a FlashCopy® point in time copy of the source disk on to a target disk, creating a map specifying the FlashCopy® point in time copy from the source disk to the target disk, creating a primary fdisk for the source disk, if one does not already exist, and creating a primary fdisk for the target disk, if one does not already exist, or, if one does I5 already exist, converting the existing primary fdisk for the target disk into a secondary fdisk, and creating a new primary fdisk for the target disk.

According to a second aspect of the present invention, there is provided a system for handling a FlashCopy® process comprising a user interface arranged to receive a FlashCopy® instruction for a source disk, and a processor arranged to perform a FlashCopy® point in time copy of the source disk on to a target disk, to create a map specifying the FlashCopy® point in time copy from the source disk to the target disk, to create a primary fdisk for the source disk, if one does not already exist, and to create a primary fdisk for the target disk, if one does not already exist, or, if one does already exist, to convert the existing primary fdisk for the target disk into a secondary fdisk, and to create a new primary fdisk for the target disk.

According to a third aspect of the present invention, there is provided a computer program product on a computer readable medium for handling a FlashCopy® process, the product comprising instructions for receiving a FlashCopy® instruction for a source disk, performing a FlashCopy® point in time copy of the source disk on to a target disk, creating a map specifying the FlashCopy® point in time copy from the source disk to the target disk, creating a primary fdisk for the source disk, if one does not already exist, and creating a primary fdisk for the target disk, if one does not already exist, or, if one does already exist, converting the existing primaty fdisk for the target disk into a secondary fdisk, and creating a new primary fdisk for the target disk.

Owing to the invention, it is possible to provide a data structure that will support the use of cascaded FlashCopy® processes using multiple source and target disks that will support reversal of any FlashCopyi) process back to a source disk, without losing any of the FlashCopye images that are represented within the cascade. Standard IO commands can still be applied to any of the source or target disks, and the nature of the data structure that has been created supports a simple handling of the IO commands, which lead to the FlashCopy® processes being correctly processed through the cascade.

The proposed solution is to allow a disk to exist a number of times in the same cascade or in separate cascades. In order to reverse a FlashCopy® map a user can simply create and start a map in the opposite direction. For example, a map from VDisk1 to VDisk2 can be reversed by creating a new map from VDisk2 to VDisk1. The present invention describes a scheme that allows both maps to be active simultaneously. This means that the image presented by VDisk2 can be maintained at the same time as VDisk1 is recovered.

This scheme introduces the concept of an fdisk, which is internal to the FlashCopy®. process, and is used to represent the source or target disk for a given FlashCopye map in the cascade. The FlashCopy® cascades are constructed between maps and fdisks. The scheme enables a map to be reversed by allowing a VDisk to be represented in multiple cascades or in multiple points in the same cascade by different fdisks. One fdisk will represent the VDisk that is being presented to the host and the other fdisks will represent the VDisk required to maintain the cascade at other points. An fdisk, in one embodiment, is an aspect of a VDisk. In this implementation, the fdisk could, for example, be an object (structure) which links the VDisk to the maps upstream and downstream of the position within the cascade.

Preferably, the method further comprising receiving an IO command for a specific disk, and processing the IO command according to a predefined set of rules relating to the existence of primary and secondary fdisks for the specific disk. In one embodiment, the predefined set of rules define cleaning of a secondary fdisk prior to processing the IO command, the cleaning comprising copying data from the specific disk to the target disk defined in the map linked to the secondary disk. The data structure can be used to maintain the correct structures in the cascade, when IO commands are received by disks, wherever they are in the cascade. The rules define the handling of the IO instructions.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

Embodiments of the present invention will now be described, by way of example only, with reference to the accompanying drawings, in which:—

FIG. 1 is a schematic diagram of a pair of storage disks,

FIG. 2 is a schematic diagram of a cascade of storage disks,

FIG. 3 is a schematic diagram of a data structure created following a FlashCopy® process,

FIG. 4 is a schematic diagram of a further data structure, and

FIG. 5 is a flowchart of a method of handling a FlashCopy® process.

DETAILED DESCRIPTION

FIG. 1 illustrates the concept of a FlashCopy® process using two disks 10. The disks 10 could form part of a larger array of disks, and would typically form part of an enterprise storage solution. The disks 10 could be part of a storage solution relating to a commercial website, for example. If at any time a backup needs to be made of the content of Vdisk1 then a FlashCopy® instruction can be sent to that disk, which defines a source disk (Vdisk1) and also a target disk, which is the target of the FlashCopy® instruction. The FlashCopy® instruction creates a point in time copy of the image of the disk which is the source disk.

In the example of FIG. 1, the source disk of a first FlashCopy® instruction is Vdisk1, and the target disk is Vdisk2. The FlashCopy® instruction starts the FlashCopy® process, which creates a map 12 from the source disk 10 to the target disk 10. This first map is labelled map 1 in the Figure. The image of Vdisk1 at this specific point in time is now available on Vdisk2. This creates a backup of the data on Vdisk1, and also allows tests and other administration tasks to be run on the data of Vdisk1, without the attendant danger of losing any of the original data, as it is preserved on the original source disk.

When a FlashCopy® point in time copy is made, it creates a link between the two disks 10, as defined by the map 12. Data may now be copied across in the background, with the additional requirement that any access to Vdisk2 (as the target disk 10) will immediately cause the relevant parts of the image of Vdisk1 to be copied across, and also any access to Vdisk 1 which would result in a change to the image stored by that disk 10 will also cause the unaltered data to be immediately copied across. In this way, the Vdisk2, to an outside user, stores the point in time copy of Vdisk1, although data will only be physically copied across under the circumstances described above.

In order to reverse a FlashCopy® map, the user or administrator can simply create and start a map 12 in the opposite direction. The user issues a FlashCopy® instruction that specifies a map from a new source to target disk. For example, the map 12 from VDisk1 to VDisk2 can be reversed by creating a new map (map 2) from VDisk2 to VDisk1. The system of the present invention, described in more detail below, describes a scheme that allows both maps 12 to be active simultaneously. This means that the image presented by VDisk2 can be maintained at the same time as VDisk1 is recovered. This is valuable in relation to, for example, FlashCopy® cascades.

FIG. 2 illustrates a FlashCopy® cascade, which exists in relation to four disks 10 that form part of an enterprise storage solution. Each map 12 within the Figure represents a FlashCopy® instruction that has resulted in a point in time copy of a Vdisk 10 being taken and passed from a source disk 10 to a target disk 10. A user has at various times requested that a disk 10 that has been the target for an earlier FlashCopy® point in time copy, should become the source for a later FlashCopy® point in time copy, in a process that creates a cascade of FlashCopy® point in time copies. Actions can be taken in respect of an image on a Vdisk 10 after a FlashCopy® point in time copy has been made.

The system allows a disk 10 to exist a number of times in the same cascade or in separate cascades. The scheme of the invention will extend to more complex graphs of trees for example. In this example, before map 4 is started, VDisk1 contains the users original set of data and VDisk2 contains a backup of that data. VDisk3 and VDisk4 contain further snapshots of the data on which two different simulations have been run. The user then decides that they like the result of the simulation on VDisk3 and want to restore this data back onto VDisk1. The scheme allows the user to start map 4 and copy the modified image from VDisk3 to Vdisk1 whilst still maintaining the unmodified backup of the original data on VDisk2.

This scheme operated by a system according to the invention, introduces the concept of an fdisk, which is a data structure internal to the FlashCopyt process, and is used to represent the source or target disk 10 for a given FlashCopy® map in the cascade. The FlashCopy® cascades are then constructed between maps 12 and fdisks. The scheme enables a map 12 to be reversed by allowing a VDisk 10 to be represented in multiple cascades or in multiple points in the same cascade by different fdisks. A first fdisk will represent the VDisk that is being presented to the host and the other fdisks will represent the VDisk required to maintain the cascade at other points.

FIG. 3 illustrates the data structure created by the system, in relation to the disks of FIG. 1, after mapl has been formed. The fdisks 14 are created, whenever there is a FlashCopy® instruction. The fdisk 14 is a logical structure, rather than the physical structure of the source and target disks 10. In the first example above, there is a map Map 1 from VDisk1 to VDisk2. When this map 12 is started, the VDisk and fdisk are arranged so that IO (input/output) commands directed to VDisk1 are redirected to FDisk11 and IO commands to VDisk2 are redirected to FDisk21. The fdisks 14 will process IO commands according to the usual cascaded algorithm. IO from the fdisk is then redirected to the appropriate VDisk below.

In the simple structure of FIG. 1, after the FlashCopy® instruction, which creates the first map 1, the creation of the fdisks 14 is a basis for dealing with more complicated cascading FlashCopy® processes. Each fdisk 14 that is created can be either a primary fdisk 14 or a secondary fdisk 14. The scheme that is used in relation to the creation of the fdisks 14 for the disks 10 is that there is created a primary fdisk 14 for the source disk 10, if one does not already exist. Additionally, there is created a primary fdisk 14 for the target disk 10, if one does not already exist, or, if one does already exist, the existing primary fdisk 14 for the target disk 10 is converted into a secondary fdisk 14, and a new primary fdisk 14 is created for the target disk 10. This data structure supports the handling of the cascading FlashCopy® processes.

For example, in FIG. 1, after the creation of the FlashCopy® backup with map 1, the user reversed the process with the FlashCopy® backup which is embodied in map 2. The data structure of FIG. 3 would be amended after this action, to look like the data structure of FIG. 4. In order to reverse VDisk2 onto VDisk1 the user creates map 2 from VDisk2 to VDisk1. When map 2 is started, a new primary fdisk 14 is created for VDisk1 and the current primary fdisk 14 is demoted to a secondary role. This is shown in the Figure, where new FDisk12 has been created, which is linked to VDisk1, and the pre-existing FDisk11 is changed to a secondary fdisk.

When future IO commands are directed to VDisk1, then firstly the secondary fdisk data must be “cleaned” and then the IO command is directed to FDisk12 as normal. Cleaning of an fdisk involves copying the existing data from that source disk onto the target disk of the first dependent map in the cascade. In this example, this would involve copying the data from Vdisk1 to Vdisk2. In this way the image presented by VDisk2 can be maintained. All future IO commands are handled according to a predefined set of rules, which relate to the existence of primary and secondary fdisks for the specific disk to which the specific IO command relates.

In the structure of FIG. 4 the fdisks could be objects defined by:

FDisk 11:

Vdisk Index: 1;

Up Map: NULL;

Dn Map: Map1

FDisk 12:

Vdisk Index: 1;

Up Map: Map 2

Dn Map: NULL

FDisk 21:

Vdisk Index: 2;

Up Map: Map 1

Dn Map: Map 2

Each fdisk has an index defining the Vdisk to which it relates, and has links to the relevant maps that define the up and down directions of the original FlashCopy® point in time copies in the cascade.

In general, each VDisk has a primary fdisk and may have secondary fdisks. A VDisk can be in one of four states governed by its primary and secondary fdisks. These states are no primary, no secondary; active primary, no secondary; active primary, active secondary; and no primary, active secondary. If there is no primary and no secondary then this implies that no FlashCopy® cascade is interested in the specific VDisk and so all IO will be passthrough. If there is an active primary, but no secondary, then this implies that the IO commands for this VDisk should be passed on to the primary fdisk for processing. There is no pre-IO cleaning to be carried out. If there is an active primary and an active secondary then this implies that the IO for this VDisk should be passed on to the primary fdisk for processing. Prior to any processing of the IO, the secondary should first be cleaned. Finally, if there is no primary, but an active secondary, then before processing the IO, the secondary should first be cleaned. Once the secondary is cleaned the IO is passthrough.

The above has been described to include the state of “no primary, active secondary”. Whether a VDisk can actually exist without a primary is dependent on the implementation. For instance, an implementation may allow the user to prematurely stop a map. This would destroy the Target fdisk, which may be a primary. At this point, the implementation could promote the secondary to a primary, or it could leave the Vdisk with no primary. It is for the implementers to decide which approach makes the most sense, but both would work.

The method of handling the FlashCopy® process to create the data structure is summarised in FIG. 5. The method comprises, firstly, step S1, which is the step of receiving a FlashCopy® instruction for a source disk. This may be received from an administrator through a suitable user interface. The remainder of the method is carried out by a processing function that is part of or attached to, the enterprise storage system that comprises the various disks.

The first step S1 is followed by step S2, in which there is performed the FlashCopy® point in time copy of the source disk on to a target disk. The next step is step S3, which comprises creating a map specifying the FlashCopy® point in time copy from the source disk to the target disk. In this way a FlashCopy® point in time copy is carried out and a map is created that contains the detail of the specific FlashCopy® point in time copy. Note that the FlashCopy® point in time copy could be a reversal of an earlier FlashCopy® point in time copy, but both actions are considered to be FlashCopy® point in time copies in the sense of copying data from a source disk to a target disk.

There is next carried out a step to check is there exists a primary fdisk for the source disk. If not, then method proceeds to step S4, which comprises creating a primary fdisk for the source disk, as one does not already exist. Note that if an fdisk already exists for the source disk, there is no need to take any action in respect of that source disk, and the method simply moves to the next check.

Once the creation of an fdisk has been completed for the source disk, if one was needed, then the next stage is to check whether a primary fdisk exists for the target disk. If the answer is no, then at step S5, there is created a primary fdisk for the target disk, as one does not already exist. If one does already exist, then the method proceeds to step SG, which comprises converting the existing primary fdisk for the target disk into a secondary fdisk. The final step of the method is the step S7 of creating a new primary fdisk for the target disk.

In this way, the data structure of fdisks and maps is created each time a FlashCopy® point in time copy is made of any source disk. Preferably the step S3 of the method also comprises linking the created map to each created primary fdisk. This ensures that a data structure is present that will support the cascading of FlashCopy® point in time copies through disks that nevertheless provides sufficient flexibility to obtain the data at different places within the cascade, without requiring the need for any complicated administrator intervention.

The scheme will also allow for any number of secondary fdisks. The number of fdisks associated with a disk determines the rules for which maps can be started simultaneously. A balance between flexibility and performance needs to be set because of the extra workload due to the cleaning IO redirected to the secondaries that must be completed before the primary IO can proceed.

As discussed above, once an IO command has been received for a specific disk, then the processing of the IO command is according to a predefined set of rules relating to the existence of primary and secondary fdisks for the specific disk. Advantageously, the predefined set of rules define cleaning of a secondary fdisk prior to processing the IO command, the cleaning comprising copying data from the specific disk to the target disk defined in the map linked to the secondary disk. 

1. A method of handling a copy process comprising: receiving a copy instruction for a point in time copy for a source disk, wherein the point in time copy creates a link between the source disk and a target disk using a map; performing the point in time copy of the source disk to the target disk; creating the map specifying the point in time copy from the source disk to the target disk; in response to determining that a primary fdisk does not exist for the source disk, creating the primary fdisk for the source disk; in response to determining that a primary fdisk does not exist for the target disk, creating the primary fdisk for the target disk; and in response to determining that the primary fdisk for the target disk does exist, converting the existing primary fdisk for the target disk into a secondary fdisk; and creating a new primary fdisk for the target disk.
 2. The method according to claim 1, further comprising: linking the map to each created primary fdisk.
 3. The method according to claim 14, further comprising: receiving an IO command for a specific disk; and processing the IO command according to a predefined set of rules relating to the existence of primary and secondary fdisks for the specific disk.
 4. The method according to claim 15, wherein the predefined set of rules define cleaning of a secondary fdisk prior to processing the IO command, and wherein the cleaning comprises: copying data from the specific disk to the target disk defined in the map linked to a secondary disk.
 5. The method of claim 1, wherein each primary fdisk and each secondary fdisk comprises an object that links a VDisk to maps upstream and downstream of a position within a cascade, wherein the cascade comprises a series of point in time copies between disks, wherein at least one target disk among the disks from an earlier point in time copy becomes a source disk for a new point in time copy.
 6. The method of claim 1, wherein a Vdisk is represented in multiple cascades with different fdisks.
 7. The method of claim 1, wherein a Vdisk is represented at different positions within a cascade with different fdisks. 